package com.tedu.bill.demo4;

import java.io.*;

/**
 * Author：毕龙
 * Date: 2024/5/28 9:24
 */
public class TestFile1 {
    public static void main(String[] args) throws IOException {
        //创建字节流
        FileInputStream fis = new FileInputStream("day14/src/test.txt");
        //转化流 将字节流转化为字符流
        Reader reader = new InputStreamReader(fis);
        //获取系统当前的时间戳
        long t1 = System.currentTimeMillis();
        int read;
        while ((read = reader.read()) != -1){
            System.out.print( (char)read);
        }
        long t2 = System.currentTimeMillis();
        //获取时间
        System.out.println(t2-t1);
        //关闭流
        reader.close();
        fis.close();
    }
}
